<%@ page contentType="text/html;charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="/lottery/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" src="/lottery/js/validate.js"></script>
<link href="/lottery/css/common.css" type="text/css" rel="stylesheet" />
<title>添加活动</title>
</head>

<body>
<div id="man_zone">
	<c:if test="${empty phase.phaseId}">
		<div class="operation_addtile">
			添加活动
		</div>
	</c:if>
	<c:if test="${!empty phase.phaseId}">
		<div class="operation_addtile">
			修改活动
		</div>
	</c:if>
<form action="<c:url value="/admin/phase.do?action=insertAndUpdate"/>" method="post" 
	name="phaseForm" id="phaseForm" onSubmit="return checkphaseForm()">

<c:set var="questionArray" value="3,4,5"/>	
<c:set var="statusResult" value="${fn:split(questionArray, ',')}"/>

<input type="hidden" name="id" value="${phase.phaseId}"/>

<table width="99%" border="0" align="center" cellpadding="3"
	cellspacing="1" class="table_style">
	<tr>
		<td width="18%" class="left_title_1">活动名称</td>
		<td width="82%"><input type="text" name="phaseName"
			id="phaseName" value="<c:out value="${phase.phaseName}"/>" title="请输入活动名称" size="50"/>
			<SPAN class="button_title"">
			<c:out value="${message}"/>
			</SPAN>
			</td>
	</tr>
	
	<tr>
		<td class="left_title_2">活动时间</td>
		<td>
			<input id="gmtstart" name="gmtstart" class="Wdate" type="text" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'gmtend\',{d:-6})||$dp.$DV(\'%y-%M-%d\',{d:1})}',maxDate:'#F{$dp.$D(\'gmtend\',{d:-2})}'})" value="<fmt:formatDate value="${phase.gmtStart}"/>"/> 
			  &nbsp;至&nbsp;
			<input id="gmtend" name="gmtend" class="Wdate" type="text" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'gmtstart\',{d:2})||$dp.$DV(\'%y-%M-%d\',{d:7})}',maxDate:'#F{$dp.$D(\'gmtstart\',{d:6})}'})" value="<fmt:formatDate value="${phase.gmtEnd}"/>"/>	
		</td>
	</tr>
	
	<tr>
		<td class="left_title_1">每日题数</td>
		<td>
			<select name="dailyQuestion" id="dailyQuestion">
				<c:forEach var="item" items="${statusResult}">
				<option value="${item}"
					<c:if test="${item == phase.dailyQuestion}"> selected="selected"</c:if>>
						${item}
					</option>
				</c:forEach>
			</select>
		</td>
	</tr>
	<tr>
		<td class="left_title_2">预计参与人数</td>
		<td><input type="text" name="exceptParticiants"
			id="exceptParticiants" value="<c:out value="${phase.exceptParticiants}"/>" size="10" title="请输入参与人数"/>
			<SPAN class="button_title"">
				大于100(用于计算中奖概率)
			</SPAN>
		</td>
	</tr>
	<tr bgcolor="#FFFFFF">
		<td></td>
		<td>
		<input type="submit" value="提交"/> 
		
		</td>
	</tr>
</table>

</form>
</div>
</body>
</html>

